using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Text;
using V2.PaidTimeOffDAL.Framework;

namespace V2.PaidTimeOffDAL
{
    public class PTODayTypeData : ENTBaseData<PTODayType>
    {
        #region Overrides

        public override List<PTODayType> Select()
        {
            using (HRPaidTimeOffDataContext db = new HRPaidTimeOffDataContext(DBHelper.GetHRPaidTimeOffConnectionString()))
            {
                return db.PTODayTypeSelectAll().ToList();
            }
        }

        public override PTODayType Select(int id)
        {
            using (HRPaidTimeOffDataContext db = new HRPaidTimeOffDataContext(DBHelper.GetHRPaidTimeOffConnectionString()))
            {
                ISingleResult<PTODayType> pTODayType = db.PTODayTypeSelectById(id);

                if (pTODayType != null)
                {
                    return pTODayType.Single();
                }
                else
                {
                    return null;
                }
            }
        }

        public override void Delete(HRPaidTimeOffDataContext db, int id)
        {
            throw new NotImplementedException();
        }

        #endregion Overrides
                
    }
}